* Master Do File
* Tax Farming Redux
/*******************************************************************************
	OVERVIEW
	This do file calls all do files needed to clean, process, and analyze data in
	order to reproduce the tables and figures in the paper. 
	
	The do files assumes that data is stored in the following folder structure 
	(as it was downloaded):
	
	* PAKTAX_ANALYSIS
		- Data
			- Cleaned Data
				- [Outputs from the compiling do file are 
					stored in sub-directories here]
			- Do Files
				- [Do files that are called in the compiling do file are 
					located in sub-directories here]
			- Raw Data
				- [Inputs for the compiling files below are 
					stored in sub-directories here]
	* PAKTAX_RANDOMIZATION
		- [Results of randomization are stored in some directory here]
	* PAPER_ANALYSIS
		- Coded Data
			- [Outputs from the analysis do file, which are used later 
				in the analysis do file, are stored in sub-directories here]
		- Do Files
			- [Do files that are called in the analysis do file are 
				located in sub-directories here]
		- RI
			- [Outputs from randomization inference are stored here]
		- Tables
			- [Final tables are exported here]
		

* Last edited: July 2015, Alyssa Lawther
*******************************************************************************/

clear all
set more off

/*******************************************************************************
* Set-up:
	Set globals that will be used/shared across all do files.
*******************************************************************************/

/* 	Set up the directory global. This will be shared across do files. 
	Just add your directory below to get set up. */
// cap cd *FILL IN HERE*
cap cd "C:\Users\alawther\Dropbox (MIT)\Pakistan\Public-Alyssa\"

global PAKTAX_ANALYSIS = "`c(pwd)'"
global PAKTAX_RANDOMIZATION = "${PAKTAX_ANALYSIS}/Data/Randomization"
global PAPER_ANALYSIS = "`c(pwd)'//Analysis/"
global DATA = "`c(pwd)'/Data/"
global TABLE_OUTPUT = "`c(pwd)'//Analysis/Tables/"
global RI_OUTPUT = "`c(pwd)'//Analysis/RI/"

/* 	Latest fiscal year / quarter for analysis. 
	Leave this fixed. These globals are referred to in the sub do files. */
global ynow = 2013
global qnow = 4

/*******************************************************************************
* Run Do Files:
	Each of these do files calls another set of do files within it. 
	Running these do files will prepare data, analyze data, and export tables
	that replicate those in the paper. 
*******************************************************************************/
** Compiling
/*	This do file is the first step in the data cleaning / processing pipeline. 
	It takes data from its raw fundamental form and cleans and compiles it into 
	something that can be combined with treatment and other analysis variables.	*/
do "1 Master Compile.do"

** Analysis
/* 	The first part of this do file compiles the cleaned data into datasets that
	will be used in analysis.
	The second part of this do file generates tables that appear in the paper. */
do "2 Master Analysis.do"
